from subprocess import call, Popen, PIPE, STDOUT

def run_cmd(cmd):
    arglist = cmd.split()
    p = Popen(arglist, stdout=PIPE, stderr=STDOUT)
    output = p.communicate()[0]
    return (p.returncode, output)
